home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tas407.zip / NHNL.TAS < prev    next >
Text File  |  1991-06-20  |  1KB  |  32 lines

  1. #output_file 'nhnl.lst'
  2. { NHNL.TAS-
  3.    This script example will show the 52 week high and low for each
  4.    ticker. If the current day's high is equal to the highest high
  5.    or the current low is equal to the lowest low, then we have a
  6.    probable new high or new low. It might also be the case that today's
  7.    high or low is just equal to the previous high or low.
  8.  
  9.    Just to make the script slightly more interesting, we will also
  10.    compute the "percentage off from high", a frequently used metric
  11.    seen in financial tables.
  12. }
  13. if first_ticker then 
  14. begin
  15.    writeln('              - CURRENT -       - 52 WEEK -     OFF');
  16.    writeln('TICKER       HIGH      LOW     HIGH      LOW    HIGH');
  17. end;
  18. high_value := HHV(h,52*5);        { compute high over 52 weeks }
  19. low_value  := LLV(L,52*5);        { compute low over 52 weeks }
  20.  
  21. off_high_value := ((high_value - c[0]) / high_value) * 100;
  22. write(TICKER,' ',h[0],' ',l[0],' ',high_value,' ',low_value,
  23.       '\t',INT(off_high_value),'%');
  24.  
  25. if high_value <= h then       { today's high is new high  }
  26.     write(' New High ');
  27.  
  28. if low_value >= l then        { today's low is new low }
  29.     write(' New Low  ');
  30.  
  31. writeln();             { end the line with a 'newline'}
  32.